﻿package manager
{
    import com.greensock.*;
    import com.sh.game.global.*;
    import flash.display.*;
    import flash.geom.*;
    import flash.utils.*;

    public class TweenVisibleManager extends Object
    {
        private const dirarr:Object;
        private var Vdic:Dictionary;
        private var baseaple:Number;
        private static var _instance:TweenVisibleManager;
        public static const Left:String = "left";
        public static const Right:String = "right";
        public static const Up:String = "up";
        public static const Down:String = "down";
        public static const Auto:String = "auto";

        public function TweenVisibleManager()
        {
            this.dirarr = {left:Right, right:Left, up:Down, down:Up};
            this.Vdic = new Dictionary();
            return;
        }// end function

        public function register(param1:DisplayObject, param2:String = "up", param3:String = "auto", param4:int = 0, param5:Number = 1.8) : void
        {
            if (!this.Vdic.hasOwnProperty(param1))
            {
                this.Vdic[param1] = new Dictionary();
                this.Vdic[param1].showdir = param2;
                this.Vdic[param1].closedir = param3;
                this.Vdic[param1].p = new Point(param1.x, param1.y);
                this.Vdic[param1].distance = param4;
                this.Vdic[param1].time = param5;
            }
            else
            {
                this.Vdic[param1].p = new Point(param1.x, param1.y);
            }
            return;
        }// end function

        public function cancel(param1:String) : void
        {
            if (this.Vdic.hasOwnProperty(param1))
            {
                this.Vdic[param1] = null;
                delete this.Vdic[param1];
            }
            return;
        }// end function

        public function changevisible(param1:DisplayObject, param2:Boolean) : void
        {
            var p:Point;
            var showdir:String;
            var closedir:String;
            var distance:int;
            var time:Number;
            var target:* = param1;
            var value:* = param2;
            var stageW:* = GlobalLayer.instance.root.stageWidth;
            var stageH:* = GlobalLayer.instance.root.stageHeight;
            var vcon:* = this.Vdic[target];
            if (vcon)
            {
                p = vcon.p;
                showdir = vcon.showdir;
                closedir = vcon.closedir;
                distance = vcon.distance;
                time = vcon.time;
                if (target.visible == true)
                {
                }
                switch(showdir)
                {
                    case Left:
                    {
                        break;
                    }
                    case Right:
                    {
                        break;
                    }
                    case Up:
                    {
                        break;
                    }
                    case Down:
                    {
                        break;
                    }
                    default:
                    {
                        break;
                        break;
                    }
                }
                if (target.visible == false)
                {
                }
                if (closedir == Auto)
                {
                }
                switch(closedir)
                {
                    case Left:
                    {
                        break;
                    }
                    case Right:
                    {
                        break;
                    }
                    case Up:
                    {
                        break;
                    }
                    case Down:
                    {
                        break;
                    }
                    default:
                    {
                        break;
                        break;
                    }
                }
            }
            return;
        }// end function

        public static function get instance() : TweenVisibleManager
        {
            var _loc_1:* = _instance || new TweenVisibleManager;
            _instance = _instance || new TweenVisibleManager;
            return _loc_1;
        }// end function

    }
}
